import 'package:dio/dio.dart';
import 'package:flutter_09_game/utils/log/utils_log.dart';
import 'package:flutter_09_game/utils/log/utils_log.dart';


class ResponseInterceptor extends Interceptor {
  @override
  void onResponse(Response response, ResponseInterceptorHandler handler) {
    super.onResponse(response, handler);
    RequestOptions option = response.requestOptions;
    logWrite("${option.uri.toString()}\n${response.data}");
  }

  @override
  Future onError(DioException err, ErrorInterceptorHandler handler) async {
    super.onError(err, handler);
    logWrite("${err.requestOptions.uri.toString()}\n$err");
  }
}
